package route

import (
	"github.com/gogf/gf/v2/net/ghttp"
	"goAdminV1/internal/controller/auth"
	"goAdminV1/internal/controller/options"
	"goAdminV1/internal/controller/permissions"
	"goAdminV1/internal/controller/role"
	"goAdminV1/internal/controller/user"
	"goAdminV1/internal/middleware"
)

// RegisterRoutes 注册相关路由
func RegisterRoutes(group *ghttp.RouterGroup) {
	// 公共路由组（无需鉴权）
	publicGroup := group.Group("/api")
	publicGroup.Bind(
		user.NewV1().User,
		auth.NewV1().Login,
	)

	// 私有路由组（需要鉴权）
	privateGroup := group.Group("/api")
	privateGroup.Middleware(middleware.JwtAuth)
	privateGroup.Bind(

		// options 模块
		options.NewV1().DataRang,
		options.NewV1().Status,
		options.NewV1().Components,
		options.NewV1().Modules,
		options.NewV1().Controllers,

		// auth 模块
		auth.NewV1().LoginOut,

		// user 模块
		user.NewV1().UserDetail,
		user.NewV1().DeleteUser,
		user.NewV1().UserOnline,
		user.NewV1().UserCreate,
		user.NewV1().UserOperateLog,
		user.NewV1().UserLoginLog,
		user.NewV1().UserUpdate,

		//	role 模块
		role.NewV1().RoleList,
		role.NewV1().RoleInfo,
		role.NewV1().RoleCreate,
		role.NewV1().RoleUpdate,
		role.NewV1().RoleDelete,

		// permissions 模块
		permissions.NewV1().PermissionCreate,
		permissions.NewV1().PermissionDelete,
		permissions.NewV1().PermissionDetail,
		permissions.NewV1().PermissionList,
		permissions.NewV1().PermissionUpdate,
		permissions.NewV1().DepartmentCreate,
		permissions.NewV1().DepartmentDelete,
		permissions.NewV1().DepartmentUpdate,
		permissions.NewV1().DepartmentList,
		permissions.NewV1().JobList,
		permissions.NewV1().JobDetail,
		permissions.NewV1().JobDisable,
		permissions.NewV1().JobCreate,
		permissions.NewV1().JobDelete,
		permissions.NewV1().JobUpdate,
	)

}
